<?php
/**
 * Created by PhpStorm.
 * User: yiyu
 * Email: smalleasyu@gmail.com
 * Date: 2020-01-29 11:13:41
 * Desc:
 */

namespace app\api\controller;

use app\base\model\user\User;
use app\base\model\user\UserWx;
use app\core\log\Log4dd;

class MyPageInfoController extends ApiBaseController
{
    protected $beforeActionList = [
        'checkLogin',
        'checkAccountState'
    ];


    public function getMyPageInfo()
    {

        $data = User::getUserPublicInfo($this->user_id);

        $data['is_bind'] = UserWx::MiniProgramIsBind($this->user_id) ? 1 : 0;

        Log4dd::info('我的页面数据', ['user_id' =>$this->user_id, 'data' => $data]);

        return $this->successReturn($data);

    }

}